local qingfu = fk.CreateSkill {
  name = "th_qingfu",
  tags = { Skill.Compulsory },
}

qingfu:addEffect(fk.TargetConfirmed, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    local room = player.room
    if not (target and player:hasSkill(qingfu.name) and room.current == player) then return end
    local from = data.from
    return from and from ~= target and (target:getHandcardNum() > target:getMaxCards() or from:getHandcardNum() > from:getMaxCards())
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    if #room:askToDiscard(target, {
      min_num = 1,
      max_num = target:getHandcardNum(),
      include_equip = false,
      skill_name = qingfu.name,
      cancelable = true,
      prompt = "#th_qingfu-ask"
    }) == 0 then
      data:setDisresponsive(target)
    end
  end
})

Fk:loadTranslationTable{
  ["th_qingfu"] = "倾覆",
  [":th_qingfu"] = "锁定技，你的回合内，一名角色成为另一名角色使用牌的目标后，若其或使用者手牌数大于手牌上限，其需弃置至少一张手牌，否则不可响应此牌。",

  ["#th_qingfu-ask"] = "倾覆：你需弃置至少一张手牌，否则不可响应此牌",
}

return qingfu